from django.contrib import admin
from .models import IndustryTrend, CompetitorAnalysis, MarketReport


@admin.register(IndustryTrend)
class IndustryTrendAdmin(admin.ModelAdmin):
    list_display = ['industry_name', 'trend_title', 'trend_score', 'created_at']
    list_filter = ['industry_name', 'created_at']
    search_fields = ['industry_name', 'trend_title', 'content']
    ordering = ['-created_at']


@admin.register(CompetitorAnalysis)
class CompetitorAnalysisAdmin(admin.ModelAdmin):
    list_display = ['competitor_name', 'industry', 'market_share', 'created_by', 'created_at']
    list_filter = ['industry', 'created_at']
    search_fields = ['competitor_name', 'industry', 'positioning']
    ordering = ['-created_at']


@admin.register(MarketReport)
class MarketReportAdmin(admin.ModelAdmin):
    list_display = ['title', 'industry', 'generated_by', 'created_at']
    list_filter = ['industry', 'created_at']
    search_fields = ['title', 'summary', 'key_findings']
    ordering = ['-created_at']
